package com.yunji.product.consumer;

import com.yunji.cabinet.bo.CabinetBO;
import com.yunji.cabinet.bo.CabinetSelectQueryBo;
import com.yunji.cabinet.domain.ContainerCell;
import com.yunji.cabinet.provide.CabinetProvide;
import com.yunji.order.bo.ExistsOrderBO;
import com.yunji.order.provide.OrderProvide;
import com.yunji.product.bo.ProductOrderBO;
import com.yunji.storage.bo.ExistsStockBO;
import com.yunji.storage.domain.StockDO;
import com.yunji.storage.provide.StockProvide;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.product.consumer
 * @Title: ProductConsumer
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-10-25 15:06:49      V1.0        HuaAo       新建类
 */
@Component
public class ProductConsumer {


    @Resource
    StockProvide stockProvide;

    @Resource
    CabinetProvide cabinetProvide;

    @Resource
    OrderProvide orderProvide;

    public boolean existsOrder(ExistsOrderBO existsOrderBO) {
        return orderProvide.existsOrder(existsOrderBO);
    }

    public void handleStock(List<StockDO> stockList) {
        stockProvide.handleStock(stockList);
    }

    public List<ContainerCell> getCabinetCellByCabinetId(Long cabinetId) {
        return cabinetProvide.getCabinetCellByCabinetId(cabinetId);
    }

    public CabinetBO selectCabinet(CabinetSelectQueryBo bo) {
        return cabinetProvide.selectCabinet(bo);
    }

    public boolean existsStock(ExistsStockBO bo) {
        return stockProvide.existsStock(bo);
    }

    public Integer countProductOrderSale(ProductOrderBO bo) {
        return orderProvide.countProductOrderSale(bo);
    }
}